﻿@model IEnumerable<AnhDuyShop.Models.Member>

@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_LayoutPage_Admin.cshtml";
}

<h2>List User Admin</h2>
<p>@Html.ActionLink("Add New User", "Create", null, new { @class = "label label-sm label-success" })</p>

<div class="panel panel-default">
    <div class="panel-heading">
        <i class="fa fa-external-link-square"></i>
        Responsive Table
        <div class="panel-tools">
            <a class="btn btn-xs btn-link panel-collapse collapses" href="#">
            </a>
            <a class="btn btn-xs btn-link panel-config" href="#panel-config" data-toggle="modal">
                <i class="fa fa-wrench"></i>
            </a>
            <a class="btn btn-xs btn-link panel-refresh" href="#">
                <i class="fa fa-refresh"></i>
            </a>
            <a class="btn btn-xs btn-link panel-expand" href="#">
                <i class="fa fa-resize-full"></i>
            </a>
            <a class="btn btn-xs btn-link panel-close" href="#">
                <i class="fa fa-times"></i>
            </a>
        </div>
    </div>
    <div class="panel-body">
        <div class="table-responsive">
            <table class="table table-bordered table-hover" id="sample-table-1">
                <thead>
                    <tr>
                        <th>ID</th>
                        <th>Email</th>
                        <th>Password</th>
                        <th>Privilege</th>
                        <th>Active</th>
                        <th>Features</th>
                    </tr>
                </thead>
                <tbody>
                    @foreach (var id in Model)
                    { 
                    <tr>
                        <td>@id.UserID</td>
                        <td>
                            @Html.ActionLink(id.UserEmail , "Details", new { id = id.UserID })
                        </td>
                        <td>@id.Password</td>
                        <td>@id.Privilege</td>
                        <td>@id.Active</td>
                        <td>
                            <div class="visible-md visible-lg hidden-sm hidden-xs">
                                @Html.ActionLink("Edit", "Edit", new { id = id.UserID }, new { @class = "btn btn-info" })
                                @Html.ActionLink("Delete", "Delete", new { id = id.UserID }, new { @class = "btn btn-danger" , onclick = "return confirm('Are you sure ?')" })
                            </div>
                        </td>
                    </tr>
                    }
                </tbody>
            </table>
        </div>
    </div>
</div>